package com.web;


import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.entity.Employee;
import com.entity.Project;
import com.service.EmployeeService;


public class CreateGoal extends HttpServlet {

	
	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		Project project=(Project)request.getSession().getAttribute("project");
		
		EmployeeService service=new EmployeeService();
		Employee employee=service.getAdmin(project.getId());
		List<Employee> employees=service.getWorkers(project.getId());
		employees.add(employee);
		
		request.setAttribute("employees", employees);
		request.getRequestDispatcher("WEB-INF/views/createGoal.jsp").forward(request, response);
	}
	
}
